package com.igeek.d0618.test3;

/**
 * @Author: zhiyu
 * @Date:17:43
 * @DESC:
 */
public class ReflectDemo1 {
    public static void main(String[] args) {
        Class<Student> studentClass = Student.class;
        try {
            Student student = studentClass.newInstance();
            student.setName("张三");
            student.setAge(23);
            System.out.println("student.toString() = " + student.toString());
        } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
